// Note, specific namespace members are imported into the global namespace rather than importing all of the members
// eg: using std::string;
// using std::endl;
// using std::cout; 
// rather than using namespace std;

// This is because Visual C++ 2010 has its own version of shared_ptr, with an identical name to boost's shared_ptr
// so if you import the entire std namespace you end up with a naming collision because the compiler does not know
// which shared_ptr you are referring to. (Note this does not apply to Code::Blocks and GCC)

#include <boost/smart_ptr.hpp>
using boost::scoped_ptr;
using boost::shared_ptr;

#include <string>
#include <iostream>
using std::string;
using std::endl;
using std::cout;

#include "Person.h"

Person printName() 
{ 	
	Person thabo("Thabo",12);
	cout << thabo.name() << endl; 
	return thabo; 
}

shared_ptr<Person> printName2() 
{ 
	shared_ptr<Person> maryanne_ptr(new Person("Maryanne",12));
	cout << maryanne_ptr->name() << endl; 
	return maryanne_ptr; 
}

void printName3(shared_ptr<Person> person_ptr) 
{ 	
	cout << person_ptr->name() << endl; 	
	return; 
}


int main()
{
	scoped_ptr<Person> sandile_ptr(new Person("Sandile",15));

	Person thabo_in_main = printName();
	cout << thabo_in_main.name() << endl;

	shared_ptr<Person> person_ptr_in_main = printName2();
	printName3(person_ptr_in_main);

	sandile_ptr.reset(new Person("Sandile2",11));
	cout << sandile_ptr->age() << endl; 

	return 0;
}


